/***************************************************************************
 *   Copyright (C) 2005 by xihe   *
 *   xihels@163.com                                                        *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef _GET_CLUSTER_INFO_H_
#define _GET_CLUSTER_INFO_H_
#include "ClusterOperateReply.h"
/**
 * 得到群信息的回复包，格式为：
 * 1. 头部
 * 2. 命令类型，1字节，得到群信息是0x4
 * 3. 回复码，1字节，成功是0x0
 * 4. 群内部ID，4字节
 * 5. 群外部ID，4字节
 * 6. 群类型，1字节
 * 7. 创建者QQ号，4字节
 * 8. 认证类型，1字节
 * 9. 未知的2字节，全0
 * 10. 群分类，2字节
 * 11. 未知的两字节，全0
 * 12. 未知的两字节，全0
 * 13. 群名称长度，1字节
 * 14. 群名称
 * 15. 未知的两字节，全0
 * 15. 群声明长度，1字节
 * 16. 群声明
 * 17. 群描述长度，1字节
 * 18. 群描述
 * 19. 群中成员的QQ号，4字节
 * 20. 分隔符，1字节，0x00
 * 21. 如果存在更多成员，重复19, 20部分
 * 22. 尾部
 */

class GetClusterInfoReplyPacket : public ClusterOperateReply {
    protected:
	GetClusterInfoReplyPacket(const uint8_t* buf, int len);
    public:
	typedef vector<uint32_t> Members;
	uint32_t getUid() const		{ return clusterId; }
	uint32_t getExternalId() const	{ return externalId; }
	uint32_t getVersionId()  const  { return versionId; }
	uint8_t  getClusterType() const { return clusterType; }
	uint32_t getCreator() const	{ return creator; }
	uint8_t  getAuthType() const	{ return authType; }
	uint16_t getCategory() const	{ return category; }
	const string& getClusterName()	const { return clusterName; }
	const string& getNotice()	const { return notice; }
	const string& getDescribing()	const { return describing; }
	const Members& getMembers()	const { return members; }

    private:
	string clusterName;
	string notice;
	string describing;
	Members members;

	uint32_t clusterId;
	// 如果是固定群，这个表示外部ID，如果是临时群，这个表示父群ID
	uint32_t externalId;
	uint32_t versionId;
	uint32_t creator;
	uint16_t category;
	// clusterType 字段表示固定群或者临时群的群类型
	uint8_t  clusterType;
	uint8_t  authType;
};

#endif // _GET_CLUSTER_INFO_H_

